# Contributor: Nicolas Lorin <androw95220@gmail.com>
# Maintainer: Nicolas Lorin <androw95220@gmail.com>
pkgname=dnscontrol
pkgver=4.7.3
pkgrel=0
pkgdesc="Synchronize your DNS to multiple providers from a simple DSL"
url="https://stackexchange.github.io/dnscontrol/"
arch="all"
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/StackExchange/dnscontrol/archive/v$pkgver.tar.gz
	dnsconfig.js"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build
}

check() {
	./dnscontrol check --config ../dnsconfig.js
}

package() {
	install -Dm755 dnscontrol "$pkgdir"/usr/bin/dnscontrol
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
3cc0b4e2f116df3c8faa1329f06cb4ba7331762381d083784a28fd04b6a7d95048e41a8148d6d0e12f193b290b1d83d5198fc60b91cfac344663df560e8ef283  dnscontrol-4.7.3.tar.gz
5503f149662dcf4d8548bc7e60bf566b2c4e7580593a15cca8f344f37103f413b860f4cb25ed38a620cf650528f133e4dc4d51824993b4e314acba5308a225d4  dnsconfig.js
"
